package mxmf.ctrl.model;

import com.fasterxml.jackson.annotation.JsonView;

import chances.smart.commons.rest.RestResponse;
import mxmf.utils.Profile;

public class ResultResponse<T> extends RestResponse {
    @JsonView(Profile.PublicView.class)
    private T result;

    public ResultResponse() {
    }

    public ResultResponse(T obj) {
        result = obj;
    }

    public ResultResponse(T obj, int code) {
        this(obj);
        this.setCode(code);
    }
    public ResultResponse(T obj, int code, String msg) {
        this(obj,code);
        this.setMsg(msg);
    }
    public ResultResponse(T obj, RestResponse response) {
        this(obj);
        this.setCode(response.getCode());
        this.setMsg(response.getMsg());
    }

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }

}
